<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla view library
jimport('joomla.application.component.view');
 
/**
 * HelloWorlds View
 */
class ForumViewTopic extends JView
{
	protected $state;

	protected $form;

	/**
	 * Display the view
	 */
	public function display($tpl = null)
	{
		$app		= JFactory::getApplication();
		$params		= $app->getParams();
		//Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));

		$state	= $this->get('State');
		$topic		= $this->get('Item');
		$user	= JFactory::getUser();
		
		$model = $this->getModel();
		$model->setState('posts.limit', 5);
		$posts		= $this->get('Posts');

		// Check for errors.
		
		if (count($errors = $this->get('Errors'))) {
			JError::raiseError(500, implode("\n", $errors));
			return false;
		}

		$this->assignRef('maxLevel',	$maxLevel);
		$this->assignRef('state',		$state);
		$this->assignRef('category',	$category);
		$this->assignRef('params',		$params);
		$this->assignRef('topic',		$topic);
		$this->assignRef('posts',		$posts);
		$this->assignRef('form',		$form);
		$this->assignRef('user',		$user);
		
		parent::display($tpl);
	}


}
